import {BlogInfo, SiteConfig} from "@/api/blogInfo/types";
import {BlogState} from "../types";

const useBlogStore = defineStore("useBlogStore", {
    state: (): { blogInfo: BlogInfo; imageList: string[] } => ({
        blogInfo: {
            siteConfig: {} as SiteConfig,
        } as BlogInfo,
        imageList: [] as string[],
    }),
    actions: {
        setBlogInfo(blogInfo: BlogInfo) {
            this.blogInfo = blogInfo;
        },
    },
    getters: {},
    persist: {
        key: "blog",
        storage: sessionStorage,
    },
});

export default useBlogStore;
